from typing import List


class Solution:
    def removeDuplicates(self, nums: List[int]) -> int:
        if not nums or len(nums) == 1:
            return len(nums)
        left = 1
        for right in range(1, len(nums)):
            if nums[right] != nums[left-1]:
                nums[left] = nums[right]
                left += 1
        return left


a = [0,0,1,1,1,2,2,3,3,4]
print(Solution().removeDuplicates(a))
print(a)

